package com.bugstack.domain.activity.reopsitory;

import com.bugstack.domain.activity.model.aggregate.CreateOrderAggregate;
import com.bugstack.domain.activity.model.aggregate.CreatePartakeOrderAggregate;
import com.bugstack.domain.activity.model.entity.*;
import com.bugstack.domain.activity.model.valobj.ActivitySkuStockKeyVO;

import java.util.Date;
import java.util.List;

/**
 * @Author: czb
 * @Description: 活动仓储服务接口
 * @DateTime: 2025/3/21 14:11
 **/
public interface IActivityRepository {

    ActivitySkuEntity queryActivitySku(Long sku);

    ActivityEntity queryRaffleActivityByActivityId(Long activityId);

    ActivityCountEntity queryRaffleActivityCountByActivityCountId(Long activityCountId);

    void doSaveCreditPayOrder(CreateOrderAggregate createOrderAggregate);

    void doSaveNoPayOrder(CreateOrderAggregate createOrderAggregate);

    void cacheActivitySkuStockCount(String cacheKey, Integer stockCount);

    boolean subtractionActivitySkuStock(Long sku, String cacheKey, Date endDateTime);

    void activitySkuStockConsumeSendQueue(ActivitySkuStockKeyVO activitySkuStockKeyVO);

    ActivitySkuStockKeyVO takeQueueValue();

    void clearQueue();

    void updateActivitySkuStock(Long sku);

    void clearActivitySkuStock(Long sku);

    UserRaffleOrderEntity queryNoUsedUserRaffleOrder(RafflePayTakeEntity rafflePayTakeEntity);

    ActivityAccountEntity queryRaffleActivityAccountByUserId(Long activityId, String userId);

    ActivityAccountMonthEntity queryActivityAccountMonthByUserId(String userId, Long activityId, String month);

    ActivityAccountDayEntity queryActivityAccountDayByUserId(String userId, Long activityId, String day);

    void savePartakeOrderAggregate(CreatePartakeOrderAggregate aggregateObj);

    List<ActivitySkuEntity> queryActivitySkuListByActivityId(Long activityId);

    Integer queryRaffleActivityAccountDayPartakeCount(Long activityId, String userId);

    void updateOrder(DeliveryOrderEntity deliveryOrderEntity);

    UnpaidActivityOrderEntity queryNoPaidOrder(SkuRechargeEntity skuRechargeEntity);

    List<SkuProductEntity> querySkuProductEntityListByActivityId(Long activityId);

    ActivitySkuStockKeyVO takeQueueValue(Long sku);

    void clearQueueValue(Long sku);

    List<Long> querySkuList();
}
